﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IllustratedCsharp7_ch8
{
    class SomeClass                      //基类
    {
        public string Filed1 = "base class field";
        public void  Method1(string value) {
            Console.WriteLine($"Base class --Method1: {value}");
        }
    }
    class OtherClass :SomeClass                  //派生类
    {
        public string Filed2 = "derived class field";
        public void Method2(string value)
        {
            Console.WriteLine($"derived class --Method2: {value}");
        }
    }
    class chapt8_2
    {
        static void _Main() {

            OtherClass oc = new OtherClass();
            oc.Method1(oc.Filed1);
            oc.Method1(oc.Filed2);
            oc.Method2(oc.Filed1);
            oc.Method2(oc.Filed2);
        }
    }
}
